package org.yray.io.rocketmqdemo.listener;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.yray.io.rocketmqdemo.utils.SpringUtil;

import java.util.Optional;

@Service
@Slf4j
public class MsgDispatcher implements IMqMsgListener{

    @Override
    public ConsumeConcurrentlyStatus doMsg(String body) {
        return null;
    }

    public static IMqMsgListener getMqMsgListener(String tags)
    {
        IMqMsgListener iMqMsgListener=SpringUtil.getBean(tags, IMqMsgListener.class);
        if(iMqMsgListener==null)
        {
            log.error("找不到消息接收器：tags={}",tags);
        }
        return iMqMsgListener;
    }
}
